import bisect
from collections import defaultdict
from itertools import accumulate
from typing import List


class Solution:
    def halfQuestions(self, questions: List[int]) -> int:
        h = defaultdict(int)
        for question in questions:
            h[question] += 1
        values = list(h.values())
        values.sort(reverse=True)
        prefix = [0] + list(accumulate(values))
        pos = bisect.bisect_left(prefix, len(questions)//2)
        return pos

if __name__ == '__main__':
    s = Solution()
    r = s.halfQuestions([13,8,3,7,5,6,11,12,3,6,6,11])
    print(r)